﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;

namespace LTKJ.RTU
{
    public class Session
    {
        private Socket _sockeclient;
        private byte[] _buffer;
        private string _ip;
        private bool _isweb = false;
        /// <summary>
        /// 设备地址码
        /// </summary>
        private string _rtuId;
        private string _heartBeat;
        private string _deviceId;
        private string _deviceName;
        /// <summary>
        /// 上次接收数据的时间
        /// </summary>
        private DateTime _lastRecDataTime;
        /// <summary>
        /// 上次发送心跳的时间
        /// </summary>
        private DateTime _lastHeartBeatTime;
        /// <summary>
        /// 心跳失败次数
        /// </summary>
        private int _heartBeatFailCount;
        /// <summary>
        /// 是否需要心跳检测
        /// </summary>
        private bool _needHeartBeat;

        public string HeartBeat
        {
            set { _heartBeat = value; }
            get { return _heartBeat; }
        }
        
        public DateTime LastHeartBeatTime
        {
            set { _lastHeartBeatTime = value; }
            get { return _lastHeartBeatTime; }
        }
        
        public int HeartBeatFailCount
        {
            set { _heartBeatFailCount = value; }
            get { return _heartBeatFailCount; }
        }
        
        public bool NeedHeartBeat
        {
            set { _needHeartBeat = value; }
            get { return _needHeartBeat; }
        }

        public string RtuId
        {
            set { _rtuId = value; }
            get { return _rtuId; }
        }

        public Socket SockeClient
        {
            set { _sockeclient = value; }
            get { return _sockeclient; }
        }

        public byte[] buffer
        {
            set { _buffer = value; }
            get { return _buffer; }
        }

        public string IP
        {
            set { _ip = value; }
            get { return _ip; }
        }

        public bool isWeb
        {
            set { _isweb = value; }
            get { return _isweb; }
        }
        
        public string DeviceId
        {
            set { _deviceId = value; }
            get { return _deviceId; }
        }

        public string DeviceName
        {
            set { _deviceName = value; }
            get { return _deviceName; }
        }

        public DateTime LastRecDataTime
        {
            set { _lastRecDataTime = value; }
            get { return _lastRecDataTime; }
        }


    }
}
